/*
 * misc.cpp
 *
 *  Created on: 2012-9-29
 *      Author: ssx
 */

#include "public.h"
#include "stdio.h"
#define BF_SIZE 1024

std::string FormatStr (const char *__format, ...) {
	char __stream[BF_SIZE];
	__builtin_va_list __local_argv;
	__builtin_va_start( __local_argv, __format );
	vsnprintf( __stream, BF_SIZE, __format, __local_argv );
	__builtin_va_end( __local_argv );
	std::string str(__stream);
	return str;
}

void MyPrint(const char *__format,...) {
	char __stream[BF_SIZE];
	__builtin_va_list __local_argv;
	__builtin_va_start( __local_argv, __format );
	vsnprintf( __stream, BF_SIZE, __format, __local_argv );
	__builtin_va_end( __local_argv );
	std::string str(__stream);
	std::cout << str << std::endl;
}
